<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>StudentTest</title>
    </head>
    <link rel="stylesheet" href="css/bootstrap.min.css"/>
        <link rel="stylesheet" href="css/style.css"/>
        <link rel="stylesheet" href="css/newcss1.css">
        <link rel="stylesheet" href="css/mycss_foradim.css"/>
        <script src="js/jquery-3.4.1.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script type="text/javascript" src="js/circle.js" charset="UTF-8"></script>
    <body>
        <br><br>
        <script>
            $(document).ready(function() {
            var totalTime = parseFloat($('#minute').text()), totalSecond = totalTime * 60, minute = $('#minute'), second = $('#second');
	    function setTimeover() {
		window.setInterval(function() {
					if (totalSecond > 0) {
						totalSecond--;
					} else if(totalSecond == 0){
                                            document.getElementById("test").submit();
                                        }else{
						minute.text(0);
						second.text(0);
						return false;
					}
					var minuteTime = Math.floor(totalSecond / 60), secondTime = totalSecond % 60;
					minute.text(minuteTime);
					second.text(secondTime);
				}, 1000);
	}
	setTimeover();
});
        </script>
        <a href="#" class="dropdown-toggle" style="position: fixed; margin-left: 1200px;">
      剩余时间: <i id="minute">60</i>分<i id="second">0</i>秒
        </a><br>
        <p style="margin-left:250px; color: #cc0000">总分：30</p>
        <form id="test" action="gasgs" method="post"  style="margin-left:250px;margin-top: 20px;width: 1100px; background-color: #ffffff;border-radius: 15px;">
            <c:forEach items="${StudentTestlist}" var="i" varStatus="vs">
                    <br>
                    <label for="${i.qid}" style="font-size:20px;width: 1000px; margin-left: 50px;">
                        <input id="${i.qid}"  name="text" style="text-align: left; margin-left: -270px; background-color:rgba(255,255,255,0);" />&nbsp;${i.qid}.${i.topic}
                    </label>
                    <br><br>
                   
                    <label for="a${i.qestionA}" ></label>
                    <input id="a${i.qestionA}" type="radio" name="select${vs.index}" style="margin-left:50px" value="A" checked="checked" />&nbsp;${i.qestionA}    
                    <br> 
                    
                    <label for="b${i.qid}"></label>
                    <input id="bb${i.qid}" type="radio" name="select${vs.index}" style="margin-left:50px" value="B"/>&nbsp;${i.qestionB}    
                    <br>
                    
                    <label for="c${i.qid}"></label>
                    <input id="c${i.qid}" type="radio" name="select${vs.index}" style="margin-left:50px" value="C"/>&nbsp;${i.qestionC}   
                    <br>
                    
                    <label for="d${i.qid}"></label>
                    <input id="d${i.qid}" type="radio" name="select${vs.index}" style="margin-left:50px" value="D"/>&nbsp;${i.qestionD}   
                    <br><br>  
            </c:forEach>
                    <button type="submit">提交考试</button>
                    </form>
        <br>
    </body>
</html>
